import React, { FC, useEffect } from "react";
import { useNavigate, Link } from "react-router-dom";
import { Button, Typography } from "antd";
import { MANAGE_INDEX_PATHNAME } from "../../router";
// import "../../_mock";
import styles from "./index.module.scss";
// import axios from "axios";
const { Title, Paragraph } = Typography;
const Home: FC = () => {
  const navigate = useNavigate();
  const clickHandler = () => {
    navigate(MANAGE_INDEX_PATHNAME);
  };

  //   useEffect(() => {
  //     // fetch("/api/test")
  //     //   .then((res) => res.json())
  //     //   .then((res) => console.log(res, "测试"));
  //     axios({
  //       url: "/api/test",
  //     }).then((res) => {
  //       console.log(res);
  //     });
  //   }, []);

  return (
    <div className={styles.container}>
      <div className={styles.info}>
        <Title>小b问卷 ｜ 在线调查</Title>
        <Paragraph>
          已经累计创建问卷 100 份，发布问卷 99 份，收到答卷 980 份
        </Paragraph>
        <div>
          <Button type="primary" onClick={clickHandler}>
            开始使用
          </Button>
        </div>
      </div>
    </div>
  );
};
export default Home;
